home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr48 / tsbat146.zip / HEX.BAT < prev    next >
DOS Batch File  |  1992-12-04  |  949b  |  41 lines

  1. @echo off
  2.  
  3. echo.
  4. echo ┌───────────────────────────────────────────────────┐
  5. echo │ Add & subtract two hexadecimal values             │
  6. echo │ By Prof. Timo Salmi, ts@uwasa.fi, Fri 4-Doc-1992  │
  7. echo └───────────────────────────────────────────────────┘
  8. echo.
  9.  
  10. rem Is help needed
  11. if "%2"=="" goto _help
  12.  
  13. rem Check that DEBUG.COM is available
  14. set _found=no
  15. if exist debug.com set _found=yes
  16. for %%d in (%path%) do if exist %%d\debug.com set _found=yes
  17. for %%d in (%path%) do if exist %%ddebug.com set _found=yes
  18. if "%_found%"=="no" goto _nodebug
  19.  
  20. rem Perform the calculation
  21. echo  Sum  Diff
  22. echo h %1 %2> debug.in
  23. echo q>> debug.in
  24. debug < debug.in
  25. del debug.in
  26. goto _out
  27.  
  28. rem Error messages
  29. :_nodebug
  30. echo File DEBUG.COM not found at path or the current directory
  31. goto _out
  32.  
  33. :_help
  34. echo Usage: HEX value1 value2
  35. echo.
  36. echo Gives the sum and the difference of two hexadecimal values
  37. echo.
  38.  
  39. :_out
  40. set _found=
  41.